package com.wemew.common.exceptionhandler;

import com.wemew.common.enums.error.Error;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
//@AllArgsConstructor  //生成有参数构造方法
//@NoArgsConstructor   //生成无参数构造
public class GuliException extends RuntimeException {
    private Integer code;//状态码
//    private String msg;//异常信息

    public GuliException(Error errorEnum){
        super(errorEnum.getMsg());
        this.code=errorEnum.getCode();
    }
    public GuliException(String msg, Integer code){
        super(msg);
        this.code=code;
    }
}
